package com.skyline.user.dao;

import com.skyline.base.dao.BaseDao;
import com.skyline.user.model.User;


public interface BasicUserDao extends BaseDao {
	/**
	 * insert用户
	 * 
	 * @param user
	 */
	public void insertUser(String email,String password,String lastloginip);

	/**
	 * 通过email来select用户
	 * 
	 * @param username
	 */
	public User queryUserByEmail(final String email);

	/**
	 * 通过id来select用户
	 * 
	 * @param id
	 */
	public User queryUserById(final Long userid);

	/**
	 * 通过email和password来select用户
	 * 
	 * @param username
	 * @param password
	 */
	public User queryUserByEmailAndPassword(final String email,
			final String password);
	
	/**
	 * 通过username来得到用户count,与queryUserByUsername共享SQL
	 * @see BasicUserDao#queryUserByEmail(String)
	 * 
	 * @param username
	 */
	public int countUserByEmail(final String email);
	
	/**
	 * 通过输入登陆IP(loginIP)来修改用户的登陆信息,记录上次登陆的时间与IP
	 * @see BasicUserDao#updateLoginInfo(String)
	 * 
	 * @param email,loginIP
	 */
	public void updateLoginInfo(final long id,final String loginIP);
}
